package com.ruoyi.worker.service.impl;

import com.ruoyi.worker.domain.TermTimeShift;
import com.ruoyi.worker.mapper.TermTimeShiftMapper;
import com.ruoyi.worker.service.TermTimeShiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: TermTimeShiftServiceImpl
 * @Description:
 * @Author: 刘松山
 * @Date: 2021/10/13 19:18
 */
@Service
public class TermTimeShiftServiceImpl implements TermTimeShiftService {
    @Autowired
    private TermTimeShiftMapper  termTimeShiftMapper;

    @Override
    public List<TermTimeShift> listTermTimeShift(TermTimeShift t) {
        return termTimeShiftMapper.listTermTimeShift(t);
    }

    @Override
    public int addTermTimeShift(TermTimeShift t) {
        int flag =termTimeShiftMapper.countTermTimeShift(t);
        if(flag >0 ){
           return -1;
        }
        flag =termTimeShiftMapper.addTermTimeShift(t);
        return flag;
    }

    @Override
    public int modifTermTimeShift(TermTimeShift t) {
        int flag =termTimeShiftMapper.countTermTimeShift(t);
        if(flag >0 ){
            return -1;
        }
        flag =termTimeShiftMapper.modifTermTimeShift(t);
        return flag;
    }

    @Override
    public int delBactchTermTimeShift(Long[] idList) {
        return termTimeShiftMapper.delBactchTermTimeShift(idList);
    }

    @Override
    public TermTimeShift getTermTimeShift(Long id) {
        return termTimeShiftMapper.getTermTimeShift(id);
    }

    @Override
    public int modifTermTimeShiftStatus(TermTimeShift t) {
        return termTimeShiftMapper.modifTermTimeShiftStatus(t);
    }
}
